package cn.hchaojie.camp.week2.qa;

import java.util.LinkedList;
import java.util.List;
import java.util.Random;

import org.junit.Test;

public class Lottery {
	private static final Random R = new Random();
	
	@Test
	public void test() {
		lottery(23);
	}
	
	public void lottery(int count) {
		List<Integer> numbers = new LinkedList<>();

		for (int i = 1; i <= count; i++) {
			numbers.add(i);
		}
		
		while (numbers.size() > 0) {
			int randomIndex = R.nextInt(numbers.size());
			int luky = numbers.remove(randomIndex);
			System.out.println(luky);
		}
	}
}
